package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Cook entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_COOK", schema = "HCD_DEV")
public class Cook extends Entity implements java.io.Serializable {

	// Fields

	private Long cookId;
	private Category categoryByTimeId;
	private Category categoryByStyleId;
	private Category categoryByTypeId;
	private String name;
	private String keywords;
	private Boolean isRecommend;
	private Integer click;
	private String summary;
	private String pic;
	private String creation;
	private String tip;
	private Long sort;
	private Long addTime;
	private Set<Material> materials = new HashSet<Material>(0);

	// Constructors

	/** default constructor */
	public Cook() {
	}

	/** minimal constructor */
	public Cook(String name, Boolean isRecommend, Integer click, String summary, String pic,
			String creation, Long sort, Long addTime) {
		this.name = name;
		this.isRecommend = isRecommend;
		this.click = click;
		this.summary = summary;
		this.pic = pic;
		this.creation = creation;
		this.sort = sort;
		this.addTime = addTime;
	}

	/** full constructor */
	public Cook(Category categoryByTimeId, Category categoryByStyleId, Category categoryByTypeId,
			String name, String keywords, Boolean isRecommend, Integer click, String summary,
			String pic, String creation, String tip, Long sort, Long addTime,
			Set<Material> materials) {
		this.categoryByTimeId = categoryByTimeId;
		this.categoryByStyleId = categoryByStyleId;
		this.categoryByTypeId = categoryByTypeId;
		this.name = name;
		this.keywords = keywords;
		this.isRecommend = isRecommend;
		this.click = click;
		this.summary = summary;
		this.pic = pic;
		this.creation = creation;
		this.tip = tip;
		this.sort = sort;
		this.addTime = addTime;
		this.materials = materials;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_COOK")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "COOK_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getCookId() {
		return this.cookId;
	}

	public void setCookId(Long cookId) {
		this.cookId = cookId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TIME_ID")
	public Category getCategoryByTimeId() {
		return this.categoryByTimeId;
	}

	public void setCategoryByTimeId(Category categoryByTimeId) {
		this.categoryByTimeId = categoryByTimeId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STYLE_ID")
	public Category getCategoryByStyleId() {
		return this.categoryByStyleId;
	}

	public void setCategoryByStyleId(Category categoryByStyleId) {
		this.categoryByStyleId = categoryByStyleId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_ID")
	public Category getCategoryByTypeId() {
		return this.categoryByTypeId;
	}

	public void setCategoryByTypeId(Category categoryByTypeId) {
		this.categoryByTypeId = categoryByTypeId;
	}

	@Column(name = "NAME", nullable = false, length = 150)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "KEYWORDS", length = 500)
	public String getKeywords() {
		return this.keywords;
	}

	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}

	@Column(name = "IS_RECOMMEND", nullable = false, precision = 1, scale = 0)
	public Boolean getIsRecommend() {
		return this.isRecommend;
	}

	public void setIsRecommend(Boolean isRecommend) {
		this.isRecommend = isRecommend;
	}

	@Column(name = "CLICK", nullable = false, precision = 8, scale = 0)
	public Integer getClick() {
		return this.click;
	}

	public void setClick(Integer click) {
		this.click = click;
	}

	@Column(name = "SUMMARY", nullable = false, length = 1000)
	public String getSummary() {
		return this.summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	@Column(name = "PIC", nullable = false, length = 200)
	public String getPic() {
		return this.pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	@Column(name = "CREATION", nullable = false)
	public String getCreation() {
		return this.creation;
	}

	public void setCreation(String creation) {
		this.creation = creation;
	}

	@Column(name = "TIP", length = 300)
	public String getTip() {
		return this.tip;
	}

	public void setTip(String tip) {
		this.tip = tip;
	}

	@Column(name = "SORT", nullable = false, precision = 15, scale = 0)
	public Long getSort() {
		return this.sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}

	@Column(name = "ADD_TIME", nullable = false, precision = 15, scale = 0)
	public Long getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Long addTime) {
		this.addTime = addTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "cook")
	public Set<Material> getMaterials() {
		return this.materials;
	}

	public void setMaterials(Set<Material> materials) {
		this.materials = materials;
	}

}